import {defineStore} from "pinia";
import {stateType} from "*.vue";

export const useCountStore = defineStore('count',{
    state:():stateType=>{
       return {
           count : 1
       }
    },
    getters:{
       doubleCount:(state):number=>{
           return  state.count * 2
       }
    },
    actions:{
        addCount(){
            this.count++
        },
        addCountN(n:number){
            this.count += n
        },
        addCountNM(n:number,m:number){
            this.count += n + m
        }

    }
})
